home *** CD-ROM | disk | FTP | other *** search
/ System Booster / System Booster.iso / SYS / s / Unpack_kat.rexx < prev    next >
OS/2 REXX Batch file  |  1996-09-26  |  2KB  |  73 lines

  1. /*************************************************************************
  2.  Unpack_kat.rexx  0.2 (1.3.96) by Eric Sauvageau
  3.  
  4.  Script for XPkatana - Will unpack the specified file.  If "?" is used as
  5.     the source file, then a file requester will open, asking for the source.
  6.  
  7.  Usage: Unpack_kat.rexx <filename>
  8. **************************************************************************/
  9.  
  10.  
  11. /*** We want answers!!! :) ***/
  12. Options results
  13.  
  14.  
  15. /***** 
  16.    We need to get the shell's path, so XPKatana will be able to
  17.    locate the desired source file.
  18. *****/
  19. path = Pragma('D','')
  20. If Right(path,1) ~= ':' Then path = path||'/'
  21.  
  22.  
  23. /*** I wanna talk to ya :) ***/
  24. Address 'KATANA'
  25.  
  26.  
  27. /*** Retrieve the filename from the command line ***/
  28. Parse Arg source
  29.  
  30. If source = "" Then Do
  31.    Say "You must specify a source filename!"
  32.    Exit 10
  33. End
  34.  
  35.  
  36. /*** Store the No Progress flag state. ***/
  37. GETFLAG NOPROGRESS ; oldprogress = result
  38.  
  39.  
  40. /*** Tell XPKatana to not open any progress window. ***/
  41. SETFLAGS NOPROGRESS 1
  42.  
  43.  
  44. /*** Tell XPKatana what is the source file. ***/
  45.   SETSOURCE source ; found = result
  46.  
  47. /*****
  48.      If XPKatana can't find it, then try again, but adding the
  49.      current process's full path.
  50. *****/
  51.   IF (found = 'NOFILE') & (source ~= '?') Then SETSOURCE path||source
  52.  
  53.  
  54.  
  55. /***
  56.    Unpack the file, keeping the same filename (unless 
  57.    "Handle Suffix" was previously enabled).
  58. ***/
  59. Say "Unpacking..."
  60. UNPACK ; error = result
  61.  
  62. If error = "ABORT" Then Do
  63.    Say "Unpacking aborted or failed!"
  64. End
  65. Else Do
  66.   Say "Done."
  67. End
  68.  
  69. /*** Restore the no progress initial state and Exit ***/
  70. SETFLAGS NOPROGRESS oldprogress
  71.  
  72. Exit
  73.